async function contentCheck(content) {
  try {
    var res = await wx.cloud.callFunction({
      name: 'contentCheck',
      data: {
        msg: content
      }
    })
    if (res.result.errCode == 0) {
      return true
    } else {
      return false
    }
  }catch(err) {
    console.log(err)
    return false
  }
}

function contentCheckSync(content){
  wx.cloud.callFunction({
    name: 'contentCheck',
    data: {
      msg: content
    }
  }).then(res => {
    console.log(res);
    if (res.result.errCode == 0)
      return true;
    return false;
 
  }).catch(err => {
    console.error(err);
    return false;
  });
}

module.exports = {
  contentCheck: contentCheck,
  contentCheckSync: contentCheckSync,
}